package com.meilai.project.service.business.intentionScheme;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.meilai.project.controller.mini.dto.MiniCustomerNeedSearchParams;
import com.meilai.project.controller.mini.vo.MiniCustomerNeedVO;
import com.meilai.project.dto.base.ApiResult;
import com.meilai.project.dto.business.intentionScheme.*;
import com.meilai.project.entity.business.intentionScheme.IntentionScheme;
import com.meilai.project.vo.business.intentionScheme.IntentionSchemeVO;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author xchen
 * @since 2022-02-23
 */
public interface IntentionSchemeService extends IService<IntentionScheme> {

    void updateContractId(Long oldContractId, Long newContractId);

    IntentionScheme queryByChooseId(Long chooseId);

    List<IntentionSchemeVO> listByRelated(Long contract_id, Integer amend_type, Long must_include_id, Integer type);

    List<IntentionSchemeVO> listAllByRelatedType(Integer amend_type);

    List<BuildingPointVO> search(@RequestBody PointProcessSearchDTO searchDTO);

    // 获取列表
    Page<IntentionSchemeVO> selectPageList(IntentionSchemeListDTO searchDTO);

    List<IntentionSchemeVO> listByContractId(Long contractId);

    void exportExcel(HttpServletResponse response, IntentionSchemeListDTO searchDTO);

    // 获取详情
    IntentionSchemeVO getOneById(Long id);

    IntentionScheme getByBillSaleId(Long billSaleId);

    ApiResult<Boolean> linkContract(IntentionSchemeLinkContractDTO dto);

    ApiResult<Boolean> unlinkContract(Long id);

    ApiResult<IntentionSchemeSaveDTO> save(IntentionSchemeSaveDTO dto);

    ApiResult<IntentionSchemeSaveDTO> lock(IntentionSchemeSaveDTO dto);

    ApiResult<PointProcessLockedMediaPointDTO> checkDateRangeLock(IntentionSchemeSaveDTO dto);

    Boolean release(Long id);

    Boolean delete(Long id);

    Boolean pushMSG(Long id);

    List<BuildingPointVO> searchAll(PointProcessSearchDTO searchDTO);

    Page<MiniCustomerNeedVO> needSelectPage(MiniCustomerNeedSearchParams params);
}
